<template>
  <div class="WorkingSchedule" v-loading="loading">
    <el-table :data="tableData" style="width: 100%" border>
      <el-table-column
        label="正常可预约时间"
        align="company"
        prop="type_no"
      ></el-table-column>
      <el-table-column label="操作" align="center">
        <template>
            <el-button type="text" size="default" style="color:red">删除</el-button>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
import {
  postApiAdminOrderIndex,
  postAdminOperateDelOrtherProduct,
} from "@/api";
export default {
  data() {
    return {
      loading: false,
      dialogVisible: false, //审核
      form: {
        start_time: "",
        end_time:"",
        type: "",
        status:"",
        page: 1,
        size: 10,
      },
      tableData: []
    };
  },
  activated() {
    let form = this.form;
    this.postApiAdminOrderIndex(form);
  },
  methods: {
    // 删除
    onDelete(id) {
      let obj = {
        id,
      };
      let { form } = this;
      this.$confirm("确定删除该标签种类?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          postAdminOperateDelOrtherProduct(obj).then((res) => {
            this.postApiAdminOrderIndex(form);
            this.$message({
              type: "success",
              message: "删除成功!",
            });
          });
        })
        .catch(() => {
          this.$message({
            type: "info",
            message: "已取消删除",
          });
        });
    },

    // 采购列表
    async postApiAdminOrderIndex(data) {
      this.loading = true;
      this.form = data;
      postApiAdminOrderIndex(data)
        .then((res) => {
          this.loading = false;
          console.log("采购列表", res);
          this.tableData = res.data;
          this.total = Number(res.total);
        })
        .catch((err) => {
          this.loading = false;
        });
    },
  },
};
</script>

<style lang="scss" scoped>
.myform {
  display: flex;
  justify-content: space-between;
  > div {
    display: flex;
  }
  &-item {
    margin-right: 10px;
  }
}
.WorkingSchedule {
  background: #ffff;
  padding: 20px;
  border-radius: 2px;
  @include boxShadow;
}
</style>
